<template>
  <router-view />
</template>

<script setup>
import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme'
import ThemeColor from '@/utils/themeColor'
import {useDark} from "@vueuse/core";
const isDark = useDark();
onMounted(() => {
  nextTick(() => {
    useSettingsStore().changeSetting({ key: 'isDarkStyle', value: isDark.value })
    if(isDark.value){
      useSettingsStore().changeSetting({ key: 'sideTheme', value: "theme-dark" })
    }
    // 初始化主题样式
    handleThemeStyle(useSettingsStore().theme)
    ThemeColor();
  })
})
</script>
